<!DOCTYPE HTML />
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>大赛首页</title>
    <?php include_once("common/common_js.php") ?>
    <link href="/css/main.css" rel="stylesheet"/>
</head>
<body>
<?php include_once("common/banner.php"); ?>
<div class="warpper">
    <?php include_once("common/mini_header.php"); ?>
    <div class="part_a " style="height:260px;">
        <div class="l kk" style="height:255px;">
            <img src='/dssy.jpg' width="267" height="230"/>
            <span><a id="doApplication" href="#">我要报名</a></span>
        </div>
        <div class="r">
            <div class="infob" style="margin-top:0;height:245px;">
                <?php if ($view['dayStar']['applicationId'] > 0) { ?>
                <div style="float:left">
                    <a href='/index.php/stars/xuanshou/<?php echo $view['dayStar']['applicationId']; ?>'><img
                            src='<?php echo $view['dayStar']['photo'] ?>' width="220px" height="243"/></a>
                </div>
                <div style="float: left; padding-left: 10px;">
                    <p>
                        昵称:<?php echo $view['dayStar']['nickname'] ?></p>

                    <p>
                        签名: <?php echo $view['dayStar']['motto'] ?>
                    </p>

                    <p>
                        年龄: <?php echo $view['dayStar']['age'] ?>
                    </p>

                    <p>
                        身高: <?php echo $view['dayStar']['height'] ?> cm
                    </p>

                    <p>
                        体重: <?php echo $view['dayStar']['weight'] ?> kg
                    </p>

                    <p>
                        爱好:<?php echo $view['dayStar']['hobby'] ?></p>

                    <p>
                        <!-- <p>
                        三围:<?php /*echo $view['dayStar']['hobby'] */?></p>

                    <p>-->
                </div>
                <?php

            }
            else
                echo "<img src='/img/none.jpg' style='width:275px;height: 250px;'/>";
                ?>
            </div>

        </div>
    </div>
    <div class="part_a " style="height:260px;">
        <div class="l kk" style="height:255px;">
            <ul>
                <?php foreach ($view['news'] as $value) { ?>
                <li><a href="/index.php/news/show/<?php echo $value['newsId'] ?>"><?php echo $value['title'] ?></a></li>
                <?php }?>
            </ul>
        </div>
        <div class="r">
            <div class="infob" style="margin-top:0;height:245px;">
                <?php echo substr($view['vote']['description'], 0, 300); ?>
            </div>

        </div>
    </div>
    <div class="part_d" style="height:230px;">
        <div class="header">
            <div class="title">今日人气之星</div>
            <!--<div class="search" style="color:white;padding-right:5px;">
                更多
            </div>-->
        </div>
        <div class="list" style="height:190px;">
            <?php foreach ($view['stars'] as $value) { ?>
            <div class="p">
                <a href='/index.php/stars/xuanshou/<?php echo $value['applicationId']; ?>'><img
                        src="<?php echo $value['photo']; ?>" width="113" height="113"/></a>
                <label><?php echo $value['name'];?>(<?php
                    $userVote = $this->modules->UserVote;
                    echo $userVote->findCountByUserId($value['applicationId'], 1);
                    ?>票) |<a href='javascript:void(0)'
                             onclick="voteApplication(<?php echo $value['applicationId']; ?>)">投票</a></label>
            </div>
            <?php }?>

        </div>
    </div>
    <div class="part_d" style="height:230px;">
        <div class="header">
            <div class="title">选手展示</div>
            <div class="search" style="color:white;padding-right:5px;">
                <a href="/index.php/stars/xuanshous">更多</a>
            </div>
        </div>
        <div class="list" style="height:190px;">
            <?php foreach ($view['lastApplication'] as $value) { ?>
            <div class="p" style="width: 108px;">
                <a href="/index.php/stars/xuanshou/<?php echo $value['applicationId']; ?>"><img
                        src="<?php echo $value['photo']; ?>" width="103" height="140"/></a>
                <label><?php echo $value['name'];?>(<?php
                    $userVote = $this->modules->UserVote;
                    echo $userVote->findCountByUserId($value['applicationId'], 1);
                    ?>票) |<a href='javascript:void(0)'
                             onclick="voteApplication(<?php echo $value['applicationId']; ?>)">投票</a></label>
            </div>
            <?php }?>


        </div>
    </div>
    <?php include("common/footer.php"); ?>
</div>
<script language="javascript">
    function voteApplication($applicationId) {
        $.get("<?php echo URL_PREFIX; ?>/ajax/voteApplication", {operatorId:1,operatedId:$applicationId}, function(data) {
            alert(data);
        })
    }
</script>
<script language="javascript">
    $("#doApplication").bind("click", function() {
        login = readcookie("baoNa_isLogin");
        if (login == "yes") {
            window.location.href = '/index.php/user/baoming';
        }
        else {
            alert("请先登录");
            return false;
        }
    })
</script>
</body>
</html>